<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="portal" uri="/WEB-INF/portal.tld" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <%@ include file="/common/sale/include/common-base.jsp"%>
  <title>个人资料-${titleName}</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

</head>
<body class="hold-transition ${sysUserColor} sidebar-mini">


<div class="wrapper">
  <!-- top start -->
  <%@include file="/common/sale/top-user.jsp" %>
  <!-- top end -->
  <!-- left start -->
  <%@include file="/common/sale/left-user.jsp" %>
  <!-- left end -->
  
	<div class="content-wrapper">
	
    <!-- Main start -->
	<section class="content">
 
 <div class="panel">
  	<div class="panel-heading">
  		<h4 class="fx2"><i class="fa fa-user-plus"></i> 个人资料</h4>
  	</div>
  	<div class="panel-body">
        <form id="myForm"  name="myForm" action="" method="post">
        <input type="hidden" name="formToken" id="formToken" value=""/>
     	<input type="hidden" name="pageName"  value="zchl-member-list.jsp"/>
       	<input type="hidden" name="formName"  value="editForm"/>
		<input type="hidden" name="uctUser.w_userId" value="${loginUser.userId }"/>
		<input type="hidden" name="uctUser.userId" value="${loginUser.userId }"/>
		<input type="hidden" name="uctUser.userEname" value="${loginUser.userEname }"/>
		<input type="hidden" name="uctUser.customerType" data-name="uctUser.customerType"/>
		<input type="hidden" name="uctUser.email" data-name="uctUser.email"/>
		<input type="hidden" name="uctUser.regSource" data-name="uctUser.regSource"/>
		<input type="hidden" name="uctUser.auditStatus" value="10"/>
		<input type="hidden" name="member.auditStatus" value="10"/>
		<input type="hidden" name="uctUser.userLevel" value="10"/>
        
        <!-- 公共模块 -->
        <table  cellpadding="0" cellspacing="0" border="0"  width="90%" class="table table-bordered">
	           <tr style="background-color: #f2f2f2;">
	              <th class="text-left"colspan="2">基本信息</th>
	            </tr>
	            <tr>
	              <th width="15%" class="text-right">用户名：</th>
	              <td><span class="col-sm-4" >${loginUser.userEname }</span></td>
	            </tr>
	           <tr>
	              <th class="text-right">姓名：</th>
	              <td>
	              <span class="col-sm-4">
	              	<input class="form-control" type="text" name="uctUser.userCname" data-name="uctUser.userCname"  placeholder="请输入姓名" required="true" value="${loginUser.userCname}"  maxlength="15"/>
	              </span>
				   </td>
	            </tr>
				<tr>
					<th class="text-right">证件类型：</th>
					<td>
					  <span class="col-sm-4">
						<select
								name="uctUser.certType" class="form-control">
									<option value="">--请选择--</option>
									<option value="">身份证</option>
									<option value="">护照</option>
									<option value="">机动车驾驶证</option>
								</select>
					</span>
					</td>
				</tr>
				<tr>
					<th class="text-right">证件号码：</th>
					<td>
					  <span class="col-sm-4">
						<input class="form-control" type="text" name="uctUser.certCode" placeholder="请输入证件号码" required="true"  maxlength="15"/>
					</span>
					</td>
				</tr>
	            <tr>
	              <th class="text-right">手机号：</th>
	              <td>
	              	<span class="col-sm-4">
	              		<input class="form-control" type="text" name="uctUser.mobile"  data-name="uctUser.mobile" placeholder="请输入手机号码"  isMobile="true" maxlength="11" />
	              	</span>
					</td>
	            </tr>
				<tr class="customer-person ">
					<th class="text-right">邮箱：</th>
					<td>
							  <span class="col-sm-4">
								<input type="text" class="form-control" name="uctUser.email" data-name="uctUser.email" size="30"  maxlength="50" placeholder="如：abczhangsan@163.com"  />
						</span>
					</td>
				</tr>
				<tr>
					<th class="text-right">性别：</th>
					<td>
						<span class="col-sm-4">
							<input name="uctUser.sex"  type="radio"/> 男
							<input name="uctUser.sex"  type="radio"/> 女
					</span>
					</td>
				</tr>
	        	<tr>
		            <th class="text-right">所在地区：</th>
		            <td colspan="3">
		            	<span class="col-sm-4">
		            	<div id="citySelect" >
							<select class="form-control prov" style="width: 45%" name="uctUser.province" data-name="uctUser.province" id="prov" ></select>
							<select class="form-control city" style="width: 45%" name="uctUser.city" data-name="uctUser.city" id="city" ></select> 
						</div>
						<script type="text/javascript">
						$("#citySelect").citySelect({  
							    //url:'${ctx}/dictSelect.action?doCode=doCity&cateEname=area&fatherValue=0',
							    prov:'110000',
							    city:'110101',
							    dist:'',
							    nodata:"none" //当子集无数据时，隐藏select 
							});
						</script>
						</span>
		            </td>
		          </tr>

				 <!-- 个人会员 -->
				 <tr  class="customer-person " style="background-color: #f2f2f2;">
	              <th class="text-left"colspan="2" >单位信息</th>
	            </tr>
	        	<tr class="customer-person ">
	              <th class="text-right">所属公司：</th>
	              <td>
		            <span class="col-sm-4">
		              <input type="text"  class="form-control" id="personCompany" name="uctUser.company" data-name="uctUser.company" size="30" maxlength="50"   placeholder="如：XXX保险有限公司"  />
	            	</span>
				  </td>
	            </tr>
				<tr class="customer-person ">
					<th class="text-right">部门：</th>
					<td>
					  <span class="col-sm-4">
						<input type="text" class="form-control" name="uctUser.position" data-name="uctUser.position" size="30"  maxlength="50" placeholder="如：金融市场部"  />
					</span>
					</td>
				</tr>
	            <tr class="customer-person ">
	              <th class="text-right">职务：</th>
	              <td>
	              <span class="col-sm-4">
	              	<input type="text" class="form-control" name="uctUser.position" data-name="uctUser.position" size="30"  maxlength="50" placeholder="如：部门经理"  />
	              </span>
				  </td>
	            </tr>
				<tr class="customer-person ">
					<th class="text-right">座机：</th>
					<td>
					  <span class="col-sm-4">
						<input type="text" class="form-control" name="uctUser.phone" data-name="uctUser.phone" size="30"  maxlength="50" placeholder="如：010-66123456"  />
					</span>
					</td>
				</tr>
				<tr class="customer-person ">
					<th class="text-right">从业类型：</th>
					<td>
						  <span class="col-sm-4">
							<input type="text" class="form-control" name="member.strFiftyThree" maxlength="50" placeholder="如：财产险公司，银行，中介公司"  />
					</span>
					</td>
				</tr>
	            <tr>
				<td align="center" colspan="2"><input type="button" onclick="doSumbit()"  name="button" id="button"  class="btn btn-danger" value="提交保存" /></td>
				</tr>
				
          </table>
          
          
        </form>
        
 <!-- 附件上传iframe元素 -->
<iframe name='uploadIframe' id='uploadIframe' frameborder='0' height='0' width='0'></iframe>
<div id="uploadIframeDefDiv" style="height:0px;" ></div>
        <!--表单结束 --> 
      </div>
    </div>
    <!--主体内容结束-->
    <div class="cls"></div>
 
 
 <script type="text/javascript">
	
	var clickMenu = "editUser";
    var mainMenus = 'nav00';
	var subMenus = 'editUser';
	
$(function(){
	//validator();
});

function doSumbit(){
    var index_submit = layer.confirm('您确定要保存此信息？', {btn: ['Yes','No'],closeBtn: 0,offset: '220px'}
        , function(){
            layer.close(index_submit);
            var index_load = layer.load(2, {shade: false,offset: '300px'});


            layer.alert("保存成功");
            layer.close(index_load);
        }, function(){});
}


function validator(){
    var mark = $("#myForm").validate({
        submitHandler: function(form){//表单提交句柄,为一回调函数，带一个参数：form
     	   var formUrl =common_submit_url;
			    if(confirm('您确定要保存此信息？')){
					var result = $.platform.submit({formId:'myForm',dataType:'json',url:formUrl});
					opDone(result.flag,result.msg)
			    }
      },  
      messages:{}  
  });
	return mark;
} 

function opDone(flag,msg){
		if(flag=="T"){
			alert(msg+",已重新申请审核，耐心等待审核");
			//window.location.href="${ctx}/sendPage/sale/web/user/index";
			window.location = '${ctx}/logout';
		}else{
			alert(msg);
		}
	}
//附件相关服务配置
var myAttaServer = '<portal:config varKey="atta_server" varFileName="unity_config"/>';
var myAttaDomain = '<portal:config varKey="atta_domain" varFileName="unity_config"/>';
	//回调函数保存信息入库(上传成功才会调用此方法)
function myBack(txtId){
}
	
	
</script>   
    
  <script type="text/javascript">
 $(function(){
	 var id = "${loginUser.userId }";
	 var paramLoadData = {"pageName":"user-reg","formName":"searchForm","member.w_memberId":id};
	 $.ajax({
	     type:'get',
	     url:common_info_url,
	     data: paramLoadData,
	     async:false,
	     dataType:"json",
	     success: function(myData){
	     	console.log(myData);
	     	
	 		var userType = myData.uctUser.userType;
	 		var customerType = myData.uctUser.customerType;
	 		
	 		$("."+userType+"-"+customerType).show();
	 	
	 			if(customerType =="person"){
	 				 $("#guanjiaCompany").attr("disabled",true);
		 			 $("#orgCompany").attr("disabled",true);
		 			 $("#orgCertNo").attr("disabled",true);
	 			}else if(customerType =="org"){
	 				 $("#guanjiaCompany").attr("disabled",true);
		 			 $("#personCompany").attr("disabled",true);
		 			 $("#personCertNo").attr("disabled",true);
	 			}
	 		
	 		//反显加载数据
	 		FormUtil.loadView("member", myData.member);
	 		FormUtil.loadView("uctUser", myData.uctUser);
	 		$(".picUrl").attr("src",myData.uctUser.picUrl);
	 		var ut ="";
	 		if(myData.uctUser.userCname == null){ ut="未填写";}
			if(myData.uctUser.userCname != null){ ut=myData.uctUser.userCname;}
			$("#topName").html(ut);
			$("#leftName").html(ut);
	 		
			DictUtil.getCommonDictData("select","#strFiftyThree","member.strFiftyThree","doCode=dictItemList&cateEname=industry","",myData.member.strFiftyThree);
			DictUtil.getCommonDictData("select","#enterpriseType","member.enterpriseType","doCode=dictItemList&cateEname=gslx","",myData.member.enterpriseType);
			
			$("#citySelect").citySelect({  
			    //url:'${ctx}/dictSelect.action?doCode=doCity&cateEname=area&fatherValue=0',
			    prov:myData.uctUser.province,
			    city:myData.uctUser.city,
			    dist:'',
			    nodata:"none" //当子集无数据时，隐藏select 
			});
	   	}
	 });
 }) ;
  

  
</script>  
    
    
    
    
    
  </div>
   </section>
    <!-- Main end -->
  </div>
    <!-- foot start -->
  <%@include file="/common/sale/foot-user.jsp" %>
  <!-- foot start -->
  




</body>
</html>